#include "MouseEvent.h"

namespace Lame3d
{
	/* MouseClickEvent Implementation */
	MouseClickEvent::MouseClickEvent(const SDL_MouseButtonEvent *evt, const Point2d &mLoc)
			: button(evt->button), pressed(evt->state == SDL_PRESSED), loc(mLoc)
	{
	}
	
	MouseClickEvent::~MouseClickEvent()
	{
	}
	
	const Point2d& MouseClickEvent::Location() const
	{
		return loc;
	}
	
	int MouseClickEvent::Button() const
	{
		return button;
	}
	
	bool MouseClickEvent::LeftButton() const
	{
		return button == SDL_BUTTON_LEFT;
	}
	
	bool MouseClickEvent::RightButton() const
	{
		return button == SDL_BUTTON_RIGHT;
	}
	
	bool MouseClickEvent::MiddleButton() const
	{
		return button == SDL_BUTTON_MIDDLE;
	}
	
	bool MouseClickEvent::Pressed() const
	{
		return pressed;
	}
	
	/* MouseMotionEvent implementation */
	MouseMotionEvent::MouseMotionEvent(const Point2d &mLoc, const Point2d &mot, bool eX, bool eY)
			: loc(mLoc), motion(mot), edgeX(eX), edgeY(eY)
	{
	}
	
	MouseMotionEvent::~MouseMotionEvent()
	{
	}
	
	const Point2d& MouseMotionEvent::Location() const
	{
		return loc;
	}
	
	const Point2d& MouseMotionEvent::Motion() const
	{
		return motion;
	}
	
	bool MouseMotionEvent::EdgeX() const
	{
		return edgeX;
	}
	
	bool MouseMotionEvent::EdgeY() const
	{
		return edgeY;
	}
}
